@import "~homeland/_vars";

.toc-container {
  display: none;
  z-index: 999;
  padding-left: 10px;
  padding-bottom: 10px;

  .dropdown-menu {
    background: var(--dropdown-menu-background-color);
    border-radius: 3px;
    padding: 15px;
    border: 1px solid var(--dropdown-menu-border-color);
    width: 300px;
    z-index: 1031;
  }

  .list-container {
    max-height: 400px;
    overflow-y: scroll;

    .list {
      padding: 0;
      margin-bottom: 0 !important;

      a {
        color: var(--primary) !important;
      }
    }
  }
}

.toc-item {
  &.toc-level-2 {
    margin-left: 0;
  }

  &.toc-level-3 {
    margin-left: 15px;
  }

  &.toc-level-4 {
    margin-left: 30px;
  }

  &.toc-level-5 {
    margin-left: 45px;
  }

  &.toc-level-6 {
    margin-left: 60px;
  }
}

@media (max-width: 768px) {
  .toc-container {
    .dropdown-menu {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: auto;
      max-height: none;
      padding: 15px;

      .list-container {
        max-height: 100%;
      }
    }
  }
}
